//---------------------------------------------------------------------------

#ifndef CommBaseH
#define CommBaseH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <queue>

using namespace std;

class Controller;

class TCommunication//:public TObject//:public Subject
{
   public:
     TCommunication()
     {
         m_Controller = NULL;
     }

     virtual UINT32 WriteBuffer(UINT8* buffer, UINT32 len) = 0;
     virtual UINT32 ReadBuffer (UINT8* buffer, UINT32 len) {return 0;};
     virtual int    Connect(AnsiString ipStr,int iPort){return 0;}
     virtual  ~TCommunication(){};

     virtual int    Setting(UINT32 speed, UINT16 port){return 0;};
     virtual int    StartService(){return 0;};
     virtual int    StopService() {return 0;};

     virtual BOOL   IsActive() = 0;
     Controller* m_Controller;

};
class TDebug
{
public:
    void EnableDebug(bool b);

};

#define         MAX_RECV_LEN         8192*10
#define         MAX_PACKET_LEN       8192

#endif
